package com.pktechan.api.enumeration;

/**
 * @program: gsPrivateSale19
 * @author: qx.zhang
 * @create: 2019-12-12 14:39
 **/
public enum BusinessTypeEnum {
    TOURIST_WHITE_WINE(0, 11, 10),//游客购买白酒
    TOURIST_BEER(0, 12, 10),//游客购买啤酒
    TOURIST_WINE(0, 13, 10),//游客购买葡萄酒
    TOURIST_YELLOW_WINE(0, 14, 10),//游客购买黄酒
    TOURIST_REGISTER_VIP(0, 21, 21),//游客注册VIP
    TOURIST_REGISTER_DISTRIBUTOR(0, 22, 22),//游客注册配送商
    VIP_WHITE_WINE(10, 11, 11),//VIP复购白酒
    VIP_BEER(10, 12, 11),//VIP复购啤酒
    VIP_WINE(10, 13, 11),//VIP复购葡萄酒
    VIP_YELLOW_WINE(10, 14, 11),//VIP复购黄酒
    VIP_VIP(10, 21, 21),//VIP购买VIP
    VIP_REGISTER_DISTRIBUTOR(10, 22, 22),//VIP注册配送商
    DISTRIBUTOR_WHITE_WINE(20, 11, 12),//配送商复购白酒
    DISTRIBUTOR_BEER(20, 12, 12),//配送商复购啤酒
    DISTRIBUTOR_WINE(20, 13, 12),//配送商复购葡萄酒
    DISTRIBUTOR_YELLOW_WINE(20, 14, 12),//配送商复购黄酒;
    DISTRIBUTOR_VIP(20, 21, 21),//配送商购买VIP;
    DISTRIBUTOR_DISTRIBUTOR(20, 22, 22),//配送商购买VIP;
    DISTRIBUTOR_DISTRIBUTOR_TEST(99, 12, 10);//测试专用;

    /**
     * 客户VIP类型
     */
    private Integer custVipType;
    /**
     * 产品类型
     */
    private Integer category;
    /**
     * 业务类型  10-游客购买 11-vip复购 12-配送商复购  21-注册VIP 22-注册配送商
     */
    private Integer businessType;

    BusinessTypeEnum(Integer custVipType, Integer category, Integer businessType) {
        this.custVipType = custVipType;
        this.category = category;
        this.businessType = businessType;
    }

    public Integer getCustVipType() {
        return custVipType;
    }

    public void setCustVipType(Integer custVipType) {
        this.custVipType = custVipType;
    }

    public Integer getCategory() {
        return category;
    }

    public void setCategory(Integer category) {
        this.category = category;
    }

    public Integer getBusinessType() {
        return businessType;
    }

    public void setBusinessType(Integer businessType) {
        this.businessType = businessType;
    }

    public static Integer getBusinessType(Integer custVipType, Integer category) {
        for (BusinessTypeEnum businessTypeEnum : BusinessTypeEnum.values()) {
            if (businessTypeEnum.custVipType.equals(custVipType) && businessTypeEnum.category.equals(category)) {
                return businessTypeEnum.getBusinessType();
            }
        }
        return null;
    }
}
